@extends('layouts.backend')
@section('title')
    操作日志 列表
@endsection

@section('body')
    <div class="row">
        <div class="ibox">
            <div class="ibox-title">
                <h5>操作日志</h5>
            </div>
            <div class="ibox-content">
                <div class="row">
                    <div class="col-md-6">
                        <form role="form" class="form-inline" method="get">
                            <div class="form-group">
                                <label for="keyword" class="sr-only">Name/Email</label>
                                <input type="text" placeholder="Enter name or email " value="{{request('keyword', '')}}" name="keyword" id="keyword" class="form-control">

                            </div>
                            <button class="btn btn-primary" type="submit">搜索</button>
                            <a href="{{ route('backend.operation_log.index') }}" class="btn btn-warning">重置</a>
                        </form>
                    </div>

                </div>
                <table class="table">
                    <thead>
                    <tr>
                        <th>#</th>
                        <th>User Name</th>
                        <th>Path</th>
                        <th>Method</th>
                        <th>IP</th>
                        <th>创建时间</th>
                        <th>Input</th>
                    </tr>
                    </thead>
                    <tbody>
                    @forelse($operation_logs as $log)
                        <tr>
                            <td>{{$log->id}}</td>
                            <td>{{$log->user_name}}</td>
                            <td>
                               {{$log->path}}
                            </td>
                            <td>{{$log->method}}</td>
                            <td>{{$log->ip}}</td>
                            <td>{{$log->created_at}}</td>
                            <td>
                                <button type="button" class="btn btn-primary" data-toggle="modal" data-target="#input_{{$log->id}}">
                                    查看
                                </button>
                                <div class="modal" id="input_{{$log->id}}" tabindex="-1" role="dialog" aria-hidden="true">
                                    <div class="modal-dialog">
                                        <div class="modal-content animated bounceInRight">
                                            <div class="modal-body">
                                                <pre>{!! var_dump($log->input) !!}</pre>
                                            </div>

                                        </div>
                                    </div>
                                </div>
                            </td>
                        </tr>
                    @empty
                        <tr>
                            <td class="text-center" colspan="7">暂无记录</td>
                        </tr>
                    @endforelse
                    </tbody>
                </table>
            </div>
            <div class="ibox-footer">
                {{$operation_logs->render()}}
            </div>
        </div>
    </div>
@endsection
